package com.ruoyi.web.service.impl;

import com.github.yulichang.base.MPJBaseServiceImpl;
import com.ruoyi.web.entity.Station;
import com.ruoyi.web.mapper.StationMapper;
import com.ruoyi.web.service.IStationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lqc
 * @since 2024-01-25
 */
@Service
public class StationServiceImpl extends MPJBaseServiceImpl<StationMapper, Station> implements IStationService {

    private final StationMapper stationMapper;
    public StationServiceImpl(StationMapper stationMapper){
        this.stationMapper = stationMapper;
    }
    /**
     * 查询充电站
     *
     * @param id 充电站主键
     * @return 充电站
     */
    @Override
    public Station selectStationById(Long id)
    {
        return stationMapper.selectStationById(id);
    }

    /**
     * 查询充电站列表
     *
     * @param station 充电站
     * @return 充电站
     */
    @Override
    public List<Station> selectStationList(Station station)
    {
        return stationMapper.selectStationList(station);
    }

    /**
     * 新增充电站
     *
     * @param station 充电站
     * @return 结果
     */
    @Override
    public int insertStation(Station station)
    {
        return stationMapper.insertStation(station);
    }

    /**
     * 修改充电站
     *
     * @param station 充电站
     * @return 结果
     */
    @Override
    public int updateStation(Station station)
    {
        return stationMapper.updateStation(station);
    }

    /**
     * 批量删除充电站
     *
     * @param ids 需要删除的充电站主键
     * @return 结果
     */
    @Override
    public int deleteStationByIds(Long[] ids)
    {
        return stationMapper.deleteStationByIds(ids);
    }

    /**
     * 删除充电站信息
     *
     * @param id 充电站主键
     * @return 结果
     */
    @Override
    public int deleteStationById(Long id)
    {
        return stationMapper.deleteStationById(id);
    }
}
